package com.ylbh.modules.hotwords.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.hotwords.dto.HotWordsDTO;
import com.ylbh.modules.hotwords.entity.ShoppingHotWords;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface ShoppingHotWordMapper extends BaseMapper<ShoppingHotWords> {

    /**
     * 获取搜索热词列表
     * @param hotWordsDTO
     * @param page
     * @return
     */
    List<ShoppingHotWords> selectHotWordsList(@Param(value = "hotWordsDTO") HotWordsDTO hotWordsDTO, Page<Integer> page);

    /**
     * 新增热词搜索
     * @param shoppingHotWords
     */
    void insertHotWords(@Param(value = "shoppingHotWords") ShoppingHotWords shoppingHotWords);

    /**
     * 删除热词
     * @param date
     * @param userId
     * @param ids
     */
    void deleteHotWordsById(@Param(value = "date") Date date,
                            @Param(value = "userId") Long userId,
                            @Param(value = "ids") List<String> ids);

    /**
     * 热词类型数量
     * @return
     */
    List selectTypeNum();
}
